/**
 * 
 * @authors Your Name (you@example.org)
 * @date    2018-07-26 10:43:44
 * @version $Id$
 */
var pg=document.getElementById('pg');
var html="";
for(var i=1;i<=8;i++){
    html+='<span class="num">'+i+'</span>';
}
pg.innerHTML=html;
var ps=pg.children;
ps[0].style.color="#ee5044";
pg.onclick=function(eve){
    for(var k=0;k<ps.length;k++){
        ps[k].style.color="#707070";
    }
    var e = eve  || window.event;
    var target = e.target || e.srcElement;
    if(target.className=="num"){
        target.style.color="#ee5044";
    }
}